package org.song.service.impl;

import org.song.mapper.CommentMapper;
import org.song.model.dto.CommentDto;
import org.song.model.vo.Comment;
import org.song.service.CommentService;
import org.song.service.impl.common.AbstractBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl extends AbstractBaseServiceImpl implements CommentService {

    @Autowired( required = true )
    @Qualifier( value = "commentMapper")
    private CommentMapper commentMapper;

    @Override
    public List<Comment> listComments( @NonNull CommentDto commentDto) {
        return commentMapper.listComments(commentDto);
    }
    

    @Override
    public int deleteComment( @NonNull Comment comment) {
        return commentMapper.deleteComment(comment);
    }

    @Override
    public int insertComment( @NonNull Comment comment) {
        return commentMapper.insertComment(comment);
    }

    @Override
    public int updateComment( @NonNull Comment comment) {
        return commentMapper.updateComment(comment);
    }
    
}
